<template>
    <ph-button v-if="visible" type="primary" @click="onClick"><slot>打开自适应预览</slot></ph-button>
</template>
<script lang="ts" setup>
import { defineProps, inject, ref } from 'vue'
import { PhButton } from '@/components'
import { getCurrentInstance } from 'vue'
import MediaQuery from 'ph-media'
const visible = ref(true)
MediaQuery.maxWidth("768px",(matches)=>{
    visible.value = !matches
})
const ins = getCurrentInstance()
const props = defineProps({
    url:String
})
const onClick = ()=>{
    if(props.url)
    ins?.proxy?.$showFrame(props.url)
}
</script>
